# coding=utf8

import sys
from openpyxl.reader.excel import load_workbook

reload(sys)
sys.setdefaultencoding('utf-8')


def process(work_book):
    wb = load_workbook(filename=work_book)
    ws = wb.worksheets[0]
    nws = wb.create_sheet()
    nr = 1
    for r in range(1, ws.max_row + 1):
        key = ws.cell(row=r, column=1).value
        source = ws.cell(row=r, column=2).value
        if source:
            values = source.split('、')
            for i in range(0, len(values)):
                nws.cell(row=nr + i, column=1).value = key
                nws.cell(row=nr + i, column=2).value = values[i]
            nr = nr + len(values)
    wb.save(work_book)

